function density= ModeDensity(Input,fSampling)
density=0; %Valor inicial
k=0;
while 2^k < length(Input)
    k=k+1;
end
rta=abs(fft([Input zeros(1,(2^(k+2) - length(Input)))]));  
b=[1,-1];
der=filter(b,1,rta);
s=sign(der);
for k=1:length(s)-1
    if(s(k)>s(k+1))
        density= density + 1;
    end
end
density=density/fSampling;